package com.atguigu.common.exception;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class GulimallException extends RuntimeException{
    private Integer code;
    private String msg;
    //gulimallEnum代表一个枚举常量，它本身就是一个对象。
    public GulimallException(GulimallEnum gulimallEnum){
        this.code=gulimallEnum.getCode();
        this.msg=gulimallEnum.getMsg();
    }

}
